package templatemethod;

public abstract class BankTemplateMethod {
    public void takeNumber() {
        System.out.println("取号排队。");
    }

    public abstract void transact();

    public boolean needEvaluate() {
        return true; // 默认需要评价
    }

    public void evaluate() {
        System.out.println("反馈评分。");
    }

    public void process() {
        this.takeNumber();
        this.transact();
        if (this.needEvaluate()) {
            this.evaluate();
        }
    }
}